Dynamic configuration of IP for a terminal equipment attached to a wireless device

ABSTRACT

Techniques for dynamically configuring IP and providing IP connectivity for a terminal equipment attached to a wireless device are described. The wireless device obtains from a wireless network a dynamically assigned IP address, an IP gateway&#39;s IP address, a subnet mask, or none or any combination thereof. Wireless device determines a host IP address (which may be the dynamically assigned IP address), a router IP address (which may be the gateway IP address or a spoofed IP address), a server IP address (which may be the router IP address), and a subnet mask (which may be obtained from the wireless network or spoofed by the wireless device). Wireless device, acting as a DHCP server, provides IP configuration for the terminal equipment, acting as a DHCP client. Wireless device thereafter forwards IP packets exchanged between the terminal equipment and wireless network and processes DHCP packets from the terminal equipment.

CLAIM OF PRIORITY

The present application is a continuation of U.S. patent applicationSer. No. 10/882,522 filed on Jun. 30, 2004, entitled “DynamicConfiguration of IP for a Terminal Equipment Attached to a WirelessDevice,” now allowed, assigned to the assignee hereof and expresslyincorporated by reference herein.

BACKGROUND

1. Field

The present invention relates generally to data communication, and morespecifically to techniques for dynamically configuring Internet Protocol(IP) for a terminal equipment attached to a wireless device.

2. Background

IP is a protocol that supports transmission of blocks of data, calleddatagrams, from source hosts to destination hosts in a packet-switcheddata network. In IP terminology, a “node” is a device that implementsIP, a “host” is a node that terminates IP packets explicitly addressedto itself, and a “router” is a host that also forwards IP packets notexplicitly addressed to itself. The source and destination hosts areidentified by fixed length IP addresses.

In a local area network (LAN), a terminal equipment (e.g., a computer)typically interacts with a Dynamic Host Configuration Protocol (DHCP)server to obtain IP configuration needed to communicate with other hostsvia IP. Such IP configuration may include, for example, an IP addressfor the terminal equipment, an IP address of a router to which theterminal equipment may send IP packets for forwarding to other hosts,and so on. The procedure for obtaining IP configuration is described ina document RFC 2131, entitled “Dynamic Host Configuration Protocol,”which is publicly available.

A terminal equipment may be attached or coupled to a wireless device(e.g., a cellular phone) to obtain IP connectivity via a wirelessnetwork (e.g., a cellular communication network). As used herein, IPconnectivity refers to the ability to transmit and receive IP packets.The wireless network may support IP packet transmission but may notdirectly support DHCP, which is often the case for many wirelessnetworks currently deployed. In this case, the terminal equipment wouldnot be able to communicate with a DHCP server in the wireless network toobtain configuration information needed for IP.

There is therefore a need in the art for techniques to support dynamicconfiguration of IP for a terminal equipment coupled to a wirelessdevice that is in communication with a wireless network, which does notdirectly support DHCP.

SUMMARY

Techniques for dynamically configuring IP for a terminal equipmentcoupled or attached to a device and for providing IP connectivity forthe terminal equipment via a network are described herein. The devicemay be a wireline or wireless device, and the network may be a wirelessor wireline network. For dynamic configuration of IP for the terminalequipment, the wireless device obtains IP configuration from thewireless network, e.g., by performing a network-specific procedure withthe wireless network. The IP configuration obtained from the wirelessnetwork may include (1) a dynamic IP address assigned by the wirelessnetwork to the wireless device for use in a data session (which iscalled the “host” IP address), (2) an IP address for an IP gatewaywithin the wireless network (which is called the “gateway” IP address),(3) a mask for a subnet on which the host IP address belongs (which iscalled the “subnet mask”), or (4) none, any one, or any combination ofthe above items. The wireless device spoofs (i.e., makes up or fakes) asubnet mask if one is not obtained from the wireless network. Thewireless device also determines an IP address for a router within thesubnet, which is called the “router” IP address and may be used by theterminal equipment to send IP packets to other hosts located outside ofthe subnet. The router IP address may be (1) the gateway IP address, ifobtained from the wireless network and belonging in the same subnet asthe host IP address, or (2) an IP address spoofed by the wirelessdevice. The wireless device, acting as a DHCP server, provides IPconfiguration for the terminal equipment, acting as a DHCP client.

The wireless device thereafter acts as both the router and DHCP serverand supports IP connectivity for the terminal equipment. The wirelessdevice receives IP packets from the terminal equipment, performs IPpacket filtering on the received IP packets to detect for IP packetsintended for the DHCP server (which are called “DHCP” packets),processes DHCP packets at the wireless device, and forwards all other IPpackets toward the wireless network. The wireless device also receivesIP packets from the wireless network and forwards these IP packetstoward the terminal equipment. The processing by the wireless deviceallows the terminal equipment to operate in the normal manner, as if ina LAN environment, even though the terminal equipment is obtaining IPconnectivity via the wireless network.

In one embodiment, a method is presented for providing Internet Protocol(IP) connectivity for a terminal equipment coupled to a wireless devicethat is in communication with a wireless network, the method comprising:determining a host IP address, a router IP address, and a subnet mask,the subnet mask being used to determine a subnet to which the host IPaddress belongs, the host IP address being an IP address assigned to theterminal equipment and used to send IP packets to the terminalequipment, and the router IP address being an IP address used by theterminal equipment to send IP packets to nodes outside of the subnet;and providing the host IP address, the router IP address, and the subnetmask to the terminal equipment, wherein the host IP address, router IPaddress, and subnet mask are used by the terminal equipment to exchangeIP packets.

In another embodiment, a method is presented for providing InternetProtocol (IP) connectivity for a terminal equipment coupled to a devicethat is in communication with a network, comprising: determining a hostIP address, which is an IP address to be assigned to the terminalequipment and used to send IP packets to the terminal equipment;deriving a router IP address, a subnet mask, or both the router IPaddress and the subnet mask, the subnet mask being used to determine asubnet to which the host IP address belongs, and the router IP addressbeing an IP address used by the terminal equipment to send IP packetsoutside of the subnet; and providing the host IP address, the router IPaddress, and the subnet mask to the terminal equipment, wherein the hostIP address, router IP address, and subnet mask are used by the terminalequipment to exchange IP packets.

In another embodiment, apparatus is presented that is operable toprovide Internet Protocol (IP) connectivity for a terminal equipment viaa wireless network, comprising: a controller operable to determine ahost IP address, a router IP address, and a subnet mask, the subnet maskbeing used to determine a subnet to which the host IP address belongs,the host IP address being an IP address assigned to the terminalequipment and used to send IP packets to the terminal equipment, and therouter IP address being an IP address used by the terminal equipment tosend IP packets outside of the subnet; and provide the host IP address,the router IP address, and the subnet mask to the terminal equipment,and wherein the host IP address, router IP address, and subnet mask areused by the terminal equipment to exchange IP packets.

BRIEF DESCRIPTION OF THE DRAWINGS

The features and nature of the present invention will become moreapparent from the detailed description set forth below when taken inconjunction with the drawings in which like reference charactersidentify correspondingly throughout and wherein:

FIG. 1 shows a terminal equipment, a wireless device, and a wirelessnetwork;

FIG. 2 shows a protocol stack for a data exchange between the terminalequipment and a remote host, via the wireless device and wirelessnetwork;

FIG. 3 shows data unit formats for the transport, network, and linklayers;

FIG. 4 shows a process performed by the wireless device to dynamicallyconfigure IP and to support IP connectivity for the terminal equipment;

FIG. 5 shows a process to obtain the router IP address and the subnetmask;

FIG. 6 shows a process to obtain a spoofed subnet mask;

FIG. 7 shows a DHCP process performed by the wireless device and theterminal equipment to dynamically configure IP for the terminalequipment; and

FIG. 8 shows a block diagram of the terminal equipment and wirelessdevice.

DETAILED DESCRIPTION

The word “exemplary” is used herein to mean “serving as an example,instance, or illustration.” Any embodiment or design described herein as“exemplary” is not necessarily to be construed as preferred oradvantageous over other embodiments or designs.

FIG. 1 shows a deployment 100 in which a wireless device 120communicates with a wireless network 130 to obtain IP connectivity andvarious other services. Wireless device 120 may be a cellular phone, amodem card, or some other wireless communication unit or device.Wireless device 120 may also be referred to as a mobile station (MS), auser equipment (UE), a user terminal, or some other terminology.Wireless network 130 includes a base station 142, a packet data entity144, and an IP gateway 150. Base station 142 provides over-the-aircommunication with wireless device 120. Packet data entity 144 controlsthe transmission of packets between base station 142 and IP gateway 150.IP gateway 150 supports data services for wireless devices in wirelessnetwork 130. For example, IP gateway 150 may be responsible for theestablishment, maintenance, and termination of PPP (Point-to-PointProtocol) sessions for the wireless devices. IP gateway 150 may alsofunction as a DHCP server that can assign dynamic IP addresses towireless devices. IP gateway 150 may couple to the Internet 160 b and/orother data networks (e.g., a data network 160 a) and can communicatewith various entities (e.g., a remote host 170) that couple to thesenetworks.

Wireless network 130 may also be viewed as being composed of a radionetwork 140 and a packet data network. Radio network 140 includes basestation 142 and packet data entity 144 and supports over-the-aircommunication, e.g., for circuit-switched and packet-switchedcommunication. The packet data network includes IP gateway 150 andsupports packet-switched communication between radio network 140 andexternal networks.

Wireless network 130 may be a Code Division Multiple Access (CDMA)network that may implement one or more CDMA standards adopted by aconsortium known as 3GPP2. These CDMA standards include IS-2000, IS-856,and IS-95. In a 3GPP2-based wireless network, packet data entity 144 isreferred to as a Packet Control Function (PCF), and IP gateway 150 isreferred to as a Packet Data Serving Node (PDSN). Wireless network 130may also be a Universal Mobile Telecommunications System (UMTS) networkthat may implement one or more standards adopted by a consortium knownas 3GPP. For example, a UMTS network may utilize Wideband-CDMA (W-CDMA)or Global System for Mobile Communications (GSM) for air interface andGeneral Packet Radio Service (GPRS) or Enhanced Data rates for GlobalEvolution (EDGE) for the packet data network. In a UMTS network, packetdata entity 144 is referred to as a Serving GPRS Support Node (SGSN),and IP gateway 150 is referred to as a Gateway GPRS Support Node (GGSN).Wireless network 130 may also be a wireless local area network (WLAN)that provides communication coverage for a limited geographic area. Forexample, wireless network 130 may be (1) an IEEE 802.11 network thatimplements an IEEE 802.11 standard (e.g., 802.11a, b, g, and so on) or(2) a Bluetooth personal area network (BT-PAN) that employs Bluetoothwireless technology. In general, wireless network 130 may be a wirelesswide area network (WWAN) (e.g., a CDMA or UMTS network) or a WLAN (e.g.,an IEEE 802.11 network or a BT-PAN).

Wireless device 120 may be coupled to a terminal equipment 110 via awireline connection (as shown in FIG. 1) or a wireless connection. Thewireline connection may be via a serial bus such as, for example, aUniversal Serial Bus (USB), an RS232/EIA232 interface, a PersonalComputer Memory Card International Association (PCMCIA) interface, anIEEE 1394 bus, and so on. Terminal equipment 110 may be a laptopcomputer, a personal digital assistant (PDA), or some other electronicunit or device. In this “attached” configuration, a wireless user canobtain data services (e.g., IP connectivity) via terminal equipment 110.To provide the data services, terminal equipment 110 communicates withwireless device 120, which further communicates with wireless network130. Wireless device 120 provides over-the-air communication for a datacall to obtain the desired data services, and terminal equipment 110supports end-to-end communication for the desired data services.

FIG. 2 shows an exemplary protocol stack 200 for a data exchange betweenterminal equipment 110 and remote host 170, via wireless device 120 andwireless network 130. The protocol stack includes a transport layer thatoperates on top of a network layer, which operates on top of a linklayer, which further operates on top of a physical layer. Terminalequipment 110 and remote host 170 may communicate via a TransmissionControl Protocol (TCP), a User Datagram Protocol (UDP), or some otherprotocol at the transport layer. TCP and UDP, which are well known inthe art, typically operate on top of IP at the network layer. Transportlayer data (e.g., for TCP and/or UDP) is encapsulated in IP packets,which are exchanged between terminal equipment 110 and remote host 170via wireless device 120, radio network 140, and IP gateway 150.

The link layer between terminal equipment 110 and wireless device 120may be Ethernet or some other protocol. In general, terminal equipment110 and wireless device 120 may communicate over any LAN-typeenvironment and may use any link layer protocol such as, for example,token ring, token bus, and so on, as described in the IEEE 802 family ofstandards. For clarity, the following description assumes that terminalequipment 110 and wireless device 120 communicate via IP over Ethernet,which is described in IEEE 802.3. The link layer between wireless device120 and wireless network 130 is typically dependent on the particulartechnology employed by the wireless network. For a 3GPP2-based network,the link layer is implemented with a PPP, which operates on top of aRadio Link Protocol (RLP). Wireless device 120 maintains a PPP sessionwith IP gateway 150 for the data session. For data exchanges, wirelessdevice 120 communicates with radio network 140 via RLP, which operateson top of an air-link interface (e.g., IS-2000 or IS-856). Radio network140 communicates with IP gateway 150 via a technology-dependentinterface (e.g., an “R-P” interface for 3GPP2-based network) thatoperates on top of a physical layer. IP gateway 150 communicates withremote host 170 via IP over a link layer and a physical layer.

FIG. 3 shows the formats and the encapsulation of data units for thetransport, network, and link layers. For TCP at the transport layer,data is sent as TCP segments, with each segment including a TCP headerand a TCP payload. The TCP header includes a source port and adestination port, where a port indicates a logical channel associatedwith the data in the payload. For IP at the network layer, data is sentas IP packets (or datagrams), with each IP packet including an IP headerand an IP payload. The IP header includes a source IP address and adestination IP address for a source node and a destination node,respectively, for the IP packet. The IP payload may carry a TCP segmentor some other data. For Ethernet at the link layer, data is sent asEthernet frames, with each frame including a Media Access Control (MAC)header and a MAC payload, as described in the IEEE 802.3. The MAC headerincludes a source MAC address and a destination MAC address for a sourcedevice and a destination device, respectively, for the frame. The MACpayload may carry an IP packet or some other data.

In order for terminal equipment 110 to communicate with remote host 170via IP, the terminal equipment and remote host are assigned different IPaddresses that uniquely identify these hosts at the network layer.Terminal equipment 110 can send data specifically to remote host 170 byusing the IP address of the remote host, and vice versa.

An IP address for a node contains 32 bits and is often expressed as:W.X.Y.Z, where W, X, Y, and Z are each an 8-bit value. The IP addressmay also be expressed as: <Subnet Addr> <Node Addr>, where Node Addr isthe address of the node within a sub-network (or simply, a subnet), andSubnet Addr is the address of the subnet. The Subnet Addr and Node Addrcollectively contain 32 bits, but each address may contain any number ofbits depending on the size of the subnet. For a given subnet address, anode address of all ones (‘1’) is reserved and used as a broadcastaddress to send IP packets to all nodes on the subnet.

A subnet mask is used to determine the subnet address of an IP address.The subnet mask has a one (‘1’) for each bit in the IP address used forthe subnet address and a zero (‘0’) for each bit used for the nodeaddress. For example, if the subnet address for a subnet contains Lbits, then the 32-bit subnet mask for the subnet would contain L onesfor the L most significant bits (msbs) of the mask and 32−L (i.e., 32minus L) zeros for the 32−L least significant bits (lsbs) of the mask.For example, if the subnet portion of the IP address is 8 bits long,then there will be 8 bits of one (‘1’) followed by 24 bits of (‘0’) inthe subnet mask. The subnet address of the IP address may be determinedby performing an AND logical operation on the IP address with the subnetmask.

Terminal equipment 110 may be equipped with a network interface cardemulator (NIC-Em) 112 that supports IP over Ethernet. The NIC-Em may bedesigned to obtain IP configuration whenever it is connected to a datanetwork or whenever a data session is initiated by a wireless user. TheIP configuration obtained by the NIC-Em may include (1) an IP addressthat the NIC-Em can use as its own IP address (i.e., the host IPaddress), if the NIC-Em does not already have an IP address, (2) an IPaddress of a default router on the subnet to which the NIC-Em can sendIP packets (i.e., the router IP address), and (3) a mask for the subnetto which the NIC-Em is attached (i.e., the subnet mask). The NIC-Em usesthe subnet mask to determine whether a given destination host to whichthe NIC-Em desires to send data is located within or outside of thesubnet. If the destination host is located within the subnet, then theNIC-Em sends IP packets directly to this host using the IP address andMAC address of the host. If the destination host is located outside ofthe subnet, then the NIC-Em determines the MAC address of the router forthis host and then sends IP packets to this host via the router usingthe MAC address of the router.

For a LAN, the NIC-Em typically obtains IP configuration via a DHCPserver. However, as noted above, many wireless networks (e.g., CDMA andGPRS networks) do not directly support DHCP. Thus, if terminal equipment110 is coupled to wireless device 120 and wireless network 130 does notdirectly support DHCP, then another mechanism is needed to dynamicallyconfigure IP for the terminal equipment.

Wireless device 120 may “spoof” a DHCP server to dynamically configureIP for terminal equipment 110, which may emulate a standard networkinterface card. For dynamic IP configuration, NIC-Em 112 within terminalequipment 110, acting as a DHCP client, broadcasts a DHCP message tolistening DHCP servers. The DHCP message may request for an assignmentof a host IP address (if the NIC-Em does not have an IP address), therouter IP address, and the subnet mask. Wireless device 120 would act asa DHCP server and provide the requested IP configuration to terminalequipment 110.

Wireless device 120 complies with expected DHCP behavior when spoofingas a DHCP server. The wireless device provides a router IP address thatis on the same subnet as the host IP address, which is what the terminalequipment typically expects. The wireless device ensures this eventhough the IP address of IP gateway 150 (i.e., the gateway IP address)may not have been provided by the wireless network or even if thegateway IP address is not located on the same subnet as the host IPaddress. The wireless device also ensures that the IP address of theDHCP server, which is being spoofed by the wireless device, is alsolocated on the same subnet as the DHCP client. This avoids the need fora relay agent to advertise the agent's own IP address as the DHCPserver's IP address.

FIG. 4 shows a flow diagram of a process 400 performed by wirelessdevice 120 to dynamically configure IP and to support IP connectivityfor terminal equipment 110. Initially, the wireless device obtains IPconfiguration from the wireless network, e.g., by performing anetwork-specific procedure with the wireless network (block 410). Forexample, in a 3GPP2-based network, the wireless device may obtain anassignment of a dynamic IP address via a PPP session with IP gateway150. From block 410, the wireless device may obtain the dynamic IPaddress assigned by the wireless network to the wireless device for usein a data session, the gateway IP address, and a subnet mask. Thewireless device may also obtain none, one, or any combination of theseitems from the wireless network. The wireless device may obtain IPconfiguration from the wireless network, for example, in response toreceiving a DHCP message from the terminal equipment, upon receiving anindication (e.g., from a wireless user at the terminal equipment) toinitiate a data session, and so on.

The wireless device then determines a host IP address, a router IPaddress, a server IP address, and a subnet mask (block 412). The host IPaddress may be the dynamic IP address assigned by the wireless networkto the wireless device. The host IP address may also be an IP addressthat is statically configured on the wireless device, e.g., duringactivation or via some other mechanism. The router IP address may be thegateway IP address provided by the wireless network. The router IPaddress may also be an IP address that the wireless device spoofs (i.e.,fakes), if the gateway IP address is not obtained from the wirelessnetwork or not in the subnet as the host IP address. The server IPaddress is the IP address of the DHCP server and is a spoofed IPaddress. Table 1 lists the various IP addresses and their descriptions.

TABLE 1 IP Addresses Description Host IP address assigned to, and usedby, the terminal IP Address equipment as its own IP address. Router IPaddress advertised to the terminal equipment for IP Address use by theterminal equipment to send IP packets to hosts located outside of thesubnet. Gateway IP address of the IP gateway in the wireless network. IPAddress Server IP address of a DHCP server, which is used by the IPAddress terminal equipment to send DHCP messages.

The wireless device also spoofs a subnet mask, if none was obtained fromthe wireless network. The router IP address, server IP address, andsubnet mask may be obtained as described below.

The wireless device (acting as the DHCP server) then performs a DHCPtransaction with the terminal equipment (acting as the DHCP client). Viathis DHCP transaction, the wireless device provides to the terminalequipment (1) the host IP address that the terminal equipment will useas its own IP address (if one is needed), (2) the router IP address thatthe terminal equipment will use to send IP packets, (3) the server IPaddress, which is the IP address of the DHCP server and is used by theterminal equipment to send DHCP messages, and (4) the subnet mask forthe subnet in which the host IP address belongs (block 420). Thewireless device may also provide other configuration information to theterminal equipment as part of the DHCP transaction, as described below.

If any of the current IP configuration changes (e.g., the host IPaddress, the router IP address, and/or the subnet mask changes), thenthe terminal equipment is provided with new IP configuration. Forexample, a new subnet mask may be determined if the host IP addressand/or the router IP address change. The terminal equipment may not beaware of the need to obtain the new IP configuration from the wirelessdevice. The terminal equipment may be triggered to initiate a DHCPtransaction to obtain the new IP configuration. This may be achieved,for example, by spoofing as if the Ethernet (LAN) connection has beendisconnected and then reconnected. This disconnection would trigger theterminal equipment to request new IP configuration from the wirelessdevice acting as the DHCP server.

The wireless device (acting as a proxy for all nodes on the subnetexcept for the terminal equipment) also performs an Address ResolutionProtocol (ARP) transaction, whenever queried by the terminal equipment,to provide a MAC address for a queried node to the terminal equipment(block 430). Blocks 420 and 430 are described in further detail below.The terminal equipment uses the IP addresses and MAC addresses to sendout data.

Thereafter, the wireless device acts as both the DHCP server and therouter to provide IP connectivity. The wireless device receives IPpackets encapsulated in Ethernet frames from the terminal equipment(block 440). The wireless device performs Ethernet terminationprocessing on the Ethernet frames received from the terminal equipment,extracts the IP packets encapsulated in the Ethernet frames, performsfiltering on the extracted IP packets, processes IP packets intended forthe DHCP server, and forwards all other IP packets to the wirelessnetwork (block 442). The wireless device also receives IP packets fromthe wireless network with the host IP address as the destination IPaddress (block 450). The wireless device encapsulates these received IPpackets in Ethernet frames and forwards the Ethernet frames to theterminal equipment (block 452).

FIG. 5 shows a flow diagram of a process 412 a for determining therouter IP address and the subnet mask. The wireless device may performprocess 412 a for block 412 in FIG. 4. Initially, the wireless devicedetermines whether a subnet mask was obtained from the wireless network(which is called the “actual” subnet mask) (block 512). If the actualsubnet mask was obtained, then the wireless device uses this subnet maskand proceeds to block 522. Otherwise, the wireless device spoofs (i.e.,makes up) a subnet mask (block 520), as described below, and thenproceeds to block 522.

In block 522, the wireless device determines whether the gateway IPaddress was obtained from the wireless network. If the answer is ‘no’,then the wireless device spoofs an IP address, as described below, andsets the router IP address to the spoofed IP address (block 526). If thegateway IP address was obtained (i.e., the answer is ‘yes’ for block522), then the wireless device determines whether the gateway IP addressand the host IP address are on the same subnet (block 524). Thisdetermination may be made using the actual subnet mask obtained from thewireless network or the spoofed subnet mask obtained in block 520. Ifthe gateway IP address and host IP address are on the same subnet, thenthe wireless device sets the router IP address to the gateway IP address(block 528). Otherwise, the wireless device proceeds to block 526 tospoof an IP address for the router IP address. A spoofed subnet mask anda spoofed IP address may be obtained as described below.

As noted above, the DHCP client typically expects the host IP addressand router IP address to belong in the same subnet. Thus, as shown inFIG. 5, the wireless device uses the gateway IP address as the router IPaddress if (1) the gateway IP address is provided by the wirelessnetwork and (2) the gateway IP address and host IP address belong in thesame subnet. The host IP address and gateway IP address may be assumedto belong in the same subnet if the subnet address in the host IPaddress, which is obtained as: (host IP address AND subnet mask), isequal to the subnet address in the gateway IP address, which is obtainedas: (gateway IP address AND subnet mask). The wireless device spoofs anIP address for the router IP address if (1) a gateway IP address is notobtained from the wireless network or (2) the gateway IP addressobtained from the wireless network is not in the same subnet as the hostIP address.

The subnet address for the subnet to which the host IP address belongscan be determined from the host IP address and the subnet mask. However,the wireless device may or may not receive the subnet mask from thewireless network. If the wireless network provides the subnet mask,which is typically not the case, then the wireless device can simply usethis subnet mask to determine the subnet address. Otherwise, thewireless device spoofs a subnet mask, if the actual subnet mask was notobtained from the wireless network.

The wireless device may spoof a subnet mask in several manners. In afirst embodiment, the wireless device derives a spoofed subnet mask forthe host IP address based on the class of the IP address. The class ofthe host IP address may be determined based on the highest order bit(s)for the IP address, as shown in Table 2. A class A IP address has ‘0’for the highest order bit (i.e., the msb), a 7-bit subnet address, and a24-bit host address. A class B IP address has ‘10’ for the two highestorder bits, a 14-bit subnet address, and a 16-bit host address. A classC IP address has ‘110’ for the three highest order bits, a 21-bit subnetaddress, and an 8-bit host address. The wireless device may derive thespoofed subnet mask for the host IP address based on its class as shownin Table 2. The first embodiment provides the largest possible subnetfor a given host IP address.

TABLE 2 Class Condition Subnet Mask Class A highest order bit of IPaddress = 0 255.0.0.0 Class B two highest order bits = 10 255.255.0.0Class C three highest order bits = 110 255.255.255.0

In a second embodiment, the wireless device derives a spoofed subnetmask based on classless subnetting. The IP address space for any givenclass may be divided into smaller subspaces using IP subnetting. Forexample, a subnet may be formed within class B having a 19-bit subnetaddress, a 10-bit node address that can range from 0 through 1022 (1023is the broadcast address), and an actual subnet mask of 255.255.252.0.Using the first embodiment, the subnet mask would be given as255.255.0.0, which is larger than the actual subnet mask of255.255.252.0. The larger spoofed subnet mask results in more IPaddresses falling in the subnet. For the example above, the spoofedsubnet mask covers a 16-bit node address range of 0 through 65,535 whilethe actual subnet mask covers a 10-bit node address range of 0 through1023. The larger spoofed subnet mask results in the wireless devicehaving to proxy for more IP addresses for ARP, as described below, butis not detrimental to the dynamic IP configuration techniques describedherein.

FIG. 6 shows a flow diagram of a process 520 a to determine the smallestpossible spoofed subnet mask for a given host IP address, in accordancewith one implementation of the second embodiment. Process 520 a may alsobe used for block 520 in FIG. 5. Initially, the rightmost zero (‘0’) bitin the host IP address is identified (block 612). This may be achievedby expressing the host IP address in binary form, starting from the lsbposition of the IP address, and traversing toward the msb position untila zero (‘0’) is encountered. This rightmost zero may be used as the msbof a spoofed node address, which has this zero as the msb and all onesto the right of this zero. This spoofed node address is the smallestpossible non-broadcast node address, since a node address that is onebit smaller than this spoofed node address would have all ones and wouldbe a broadcast address. The more significant bits in the host IP addressto the left of the rightmost zero may be considered as belonging to thesubnet address. The spoofed subnet mask is then determined based on thebit position of the rightmost zero (block 614). The spoofed subnet maskcontains a one (‘1’) for each bit in the IP address that is moresignificant than the rightmost zero.

A determination is then made whether the spoofed subnet mask is smallerthan a minimum subnet mask (block 616). The smallest spoofed subnetshould support a minimum of two valid IP addresses (which are differentfrom the broadcast address)—one for the host IP address and another forthe router IP address. A subnet mask of 255.255.255.254 supports onlyone valid IP address of <Subnet Addr> <0>, since the IP address of<Subnet Addr> <1> is the broadcast address for the subnet. A subnet maskof 255.255.255.252 supports three valid IP addresses plus the broadcastaddress and may thus be used as the minimum subnet mask. If the spoofedsubnet mask is smaller than the minimum subnet mask, as determined inblock 616, then the spoofed subnet mask is set to the minimum subnetmask (block 618). The process then terminates.

The wireless device may spoof an IP address, if needed, based on theactual or spoofed subnet mask and the host IP address. The wirelessdevice obtains the subnet address (Subnet Addr) by performing thelogical operation (host IP address AND subnet mask), discarding all bitsof the AND result corresponding to zeros in the subnet mask, and settingthe Subnet Addr to all bits of the AND result corresponding to ones inthe subnet mask. The wireless device may then form a spoofed IP addressas <Subnet Addr> <0>. If the spoofed IP address is the same as the hostIP address, then the wireless device may form another spoofed IP addressas <Subnet Addr> <1>. In any case, the wireless device obtains two validIP addresses (for the host IP address and the router IP address) in thesubnet defined by the (actual or spoofed) subnet mask.

Since a router may also perform the function of a DHCP server, thewireless device can act as both the router and the DHCP server for theterminal equipment. The wireless device may use the same IP address forboth the router IP address and the server IP address.

For clarity, three examples for determining the subnet mask of a givenhost IP address and spoofing an IP address for the router IP address aregiven below. For these examples, the first zero in the least-mostsignificant bit position of the host IP address is bolded andunderlined. For example 3, the spoofed subnet mask obtained from thehost IP address is smaller than the minimum subnet mask, and is thus setequal to the minimum subnet mask. Also for example 3, the spoofed IPaddress is obtained with a node address of <1> (instead of <0>) since aspoofed IP address with <0> is equal to the host IP address.

EXAMPLE 1

-   Host IP address=129.46.217.49=10000001.00101110.11011001.00110001-   Subnetmask=255.255.255.252=11111111.11111111.11111111.11111100-   Subnet address=10000001.00101110.11011001.001100-   Node address=01-   Spoofed IP address=129.46.217.48=10000001.00101110.11011001.00110000

EXAMPLE 2

-   Host IP address=129.46.217.47=10000001.00101110.11011001.00101111-   Subnetmask=255.255.255.224=11111111.11111111.11111111.11100000-   Subnet address=10000001.00101110.11011001.001-   Node address=01111-   Spoofed IP address=129.46.217.48=10000001.00101110.11011001.00100000

EXAMPLE 3

-   Host IP address=129.46.217.32=10000001.00101110.11011001.00100000-   Subnetmask=255.255.255.252=11111111.11111111.11111111.11111100-   Subnet address=10000001.00101110.11011001.0010000-   Node address=00-   Spoofed IP address=129.46.217.33=10000001.00101110.11011001.00100001

FIG. 7 shows a signal flow for a process 420 a performed by wirelessdevice 120 and terminal equipment 110 to dynamically configure IP forthe terminal equipment. Process 420 a may be used for block 420 in FIG.4.

The terminal equipment, acting as a DHCP client, initiates a DHCPtransaction by broadcasting a DHCPDISCOVER message, which may requestfor an IP address for use by the terminal equipment (step 712). A DHCPmessage may be sent as a UDP datagram, and a Source Port field in a UDPheader may be set to ‘67’ to indicate that the message is from a DHCPserver and to ‘68’ to indicate that the message is from a DHCP client. ADestination Port field in the UDP header may similarly be set to ‘67’or‘68’ to indicate that the intended recipient of the message is the DHCPserver or DHCP client, respectively. The wireless device performsfiltering on IP packets received from the terminal equipment and candetect IP packets for DHCP messages based on the source and destinationport numbers in the UDP header, a value (for UDP) in a Protocol field ofthe IP header, and/or some other filter parameters.

Upon receiving the DHCPDISCOVER message, the wireless device may obtainIP configuration from the wireless network, e.g., by performing anetwork-specific procedure with the wireless network, if thisinformation is not already available (step 714). The wireless device mayalso use (1) a preconfigured IP address that is statically assigned tothe wireless device or (2) a private IP address that is spoofed by thewireless device. The wireless device, acting as a DHCP server, thenresponds by sending to the terminal equipment a DHCPOFFER message (block716), which contains the following:

-   -   Host IP address—set to the static or dynamic IP address assigned        to the wireless device.    -   Router IP address—set to either the gateway IP address or the        spoofed IP address obtained as described above.    -   Server IP address—set to the router IP address.    -   Subnet mask—set to either the actual subnet mask obtained from        the wireless network or the spoofed subnet mask.

In a LAN environment, multiple DHCP servers may receive the DHCPDISCOVERmessage broadcast by the terminal equipment, and the terminal equipmentmay receive multiple DHCPOFFER messages from these DHCP servers. Theterminal equipment would then select one of the DHCP servers to requestIP configuration. For the deployment shown in FIG. 1, the wirelessdevice intercepts and processes all DHCP messages from the terminalequipment. As a result, the terminal equipment receives the DHCPOFFERmessage from only one DHCP server, which is being spoofed by thewireless device. The terminal equipment then broadcasts a DHCPDISCOVERmessage, which identifies the DHCP server selected by the terminalequipment and includes the host IP address and the server IP addresssent in the DHCPOFFER message (step 718). The wireless device receivesthe DHCPOFFER message, commits the IP configuration (e.g., the host IPaddress) (step 720), and replies by sending a DHCPACK message thatcontains all of the pertinent IP configuration (step 722). The wirelessdevice in effect assigns its static or dynamic IP address to theterminal equipment via the DHCP transaction. The terminal equipmentthereafter uses the IP configuration in the normal manner, as ifconnected to a LAN, and exchanges data using this IP configuration (step724, which corresponds to blocks 440 through 452 in FIG. 4). Theterminal equipment may relinquish the host IP address by sending aDHCPRELEASE message to the DHCP server (step 726).

The router IP address may be the gateway IP address or a spoofed IPaddress. If the router IP address is the gateway IP address, then thewireless device is using the IP address of another node. If the routerIP address is a spoofed IP address, then the wireless device may beusing the IP address of another node.

To minimize the impact caused by duplicate IP address usage, thewireless device performs IP packet filtering to detect for IP packetscarrying DHCP messages (or simply, DHCP packets) intended for the DHCPserver. These DHCP packets may be detected based on (1) the server IPaddress in the Destination Address field of the IP header and (2) theUDP port number in the Destination Port field of the UDP header. TheDHCP packets are passed up the protocol stack for processing by a DHCPserver engine within the wireless device. For all other IP packetsreceived from the terminal equipment with the router IP address in theDestination Address field, the wireless device forwards these IP packetsto the wireless network. Thus, even if the wireless device spoofs an IPaddress that happens to be another node's IP address, this node wouldstill receive all IP packets (except for the DHCP packets) destined forthis IP address. Since a terminal equipment attached to a wirelessdevice normally does not need to send DHCP packets over a wirelessnetwork to a DHCP server in the network, the interception of DHCPpackets by the wireless device is not problematic.

If the NIC-Em at the terminal equipment implements IP over Ethernet asshown in FIG. 2, which is often the case, then the NIC-Em requires a MACaddress for each destination IP address to which the NIC-Em desires tosend data. If the destination IP address belongs in the same subnet asthe NIC-Em, which can be determined from the host IP address and thesubnet mask obtained from the dynamic IP configuration, then the NIC-Emsends data to this IP address directly. If the destination IP address isoutside of the subnet, then the NIC-Em typically sends data to this IPaddress via the router, using the router IP address obtained from the IPconfiguration.

The NIC-Em typically maintains an ARP table that contains an entry foreach IP address to which the NIC-Em has sent data and the IP addressbelongs to the same subset as the host IP address. Each table entrycontains the IP address and an associated MAC address. To transmit datato a given destination IP address, the NIC-Em forms an IP packet withthat destination IP address, obtains the MAC address associated withthis IP address from the ARP table, forms an Ethernet frame with theassociated MAC address as the destination MAC address, and encapsulatesthe IP packet in the payload of the Ethernet frame, e.g., as shown inFIG. 3. A device whose MAC address matches the destination MAC addresswould receive the Ethernet frame and decapsulate IP packet from theEthernet frame. The device then would either (1) process the IP packet,if the device is the intended destination of the IP packet, or (2)forward the IP packet to the next network element.

If the NIC-Em does not have an ARP entry for a given IP address withinthe same subnet as the host IP address, then the NIC-Em broadcasts anEthernet frame for an ARP request. This ARP request includes the IPaddress for which the MAC address is being sought (which is also calledthe “queried” IP address). A device that can receive IP packets with thequeried IP address would then respond by sending to the NIC-Em anEthernet frame for an ARP reply. This ARP reply includes the MAC addressof the device that sent the reply and that can receive IP packets withthe queried IP address. The NIC-Em receives the ARP reply, extracts theMAC address from the ARP reply, and stores the MAC address in the ARPtable for future use. If the NIC-Em desires to send data to an IPaddress outside of the subnet, the NIC-Em first sends the data to therouter on the subnet. In order to send the data via Ethernet, the NIC-Emneeds the MAC address of the router. If the NIC-Em does not have an ARPentry for the router IP address, then the NIC-Em may send an ARP for theIP address of the router to obtain the MAC address of the router, whichcan route IP packets to the final destination IP address.

Since the wireless device terminates the Ethernet protocol for theterminal equipment, as shown in FIG. 2, the wireless device also servesas a proxy for all IP addresses in the same subnet as the terminalequipment, except for IP addresses that have been assigned to otherhosts on the subnet. If the wireless device receives an ARP request fromthe terminal equipment for the MAC address corresponding to the routerIP address, then the wireless device sends an ARP reply containing thewireless device's MAC address, since the wireless device is spoofing therouter. If the wireless device receives an ARP request from the terminalequipment for the MAC address corresponding to another IP address withinthe same subnet, which is not the host IP address or the router IPaddress, then the wireless device serves a proxy for this IP address andalso sends an ARP reply containing the wireless device's MAC address.The terminal equipment would then send Ethernet frames for all IPpackets for IP addresses within the subnet to the wireless device, whichthen forwards all IP packets except those for DHCP to the wirelessnetwork.

If the wireless device is supporting only one terminal equipment for IP(e.g., via a direct connection such as a USB, an RS232/EIA232 interface,and so on), then there may be only two nodes (the router and theterminal equipment) on the subnet being spoofed by the wireless device,and the wireless device can receive all IP packets from the terminalequipment and either terminate or forward these IP packets. If thewireless device is supporting multiple terminal equipmentssimultaneously for IP (e.g., via an IEEE-802.11 network or a BluetoothPAN), then the wireless device keeps track of all IP addresses assignedto hosts on the subnet. The wireless device would only proxy for IPaddresses that have not been assigned to any host on the subnet andwould only send ARP replies for ARP requests for unassigned IPaddresses.

The wireless device may also send an ARP request to the terminalequipment to obtain the MAC address of the terminal equipment.

As shown in FIG. 4, the wireless device performs various functions sothat the terminal equipment can operate in the normal manner as if in aLAN environment. The terminal equipment need not be aware that IPconfiguration is being obtained via a wireless network. The wirelessdevice spoofs the DHCP server and provides the terminal equipment withthe IP configuration (e.g., the host IP address, router IP address,server IP address, and subnet mask). As part of configuring the terminalequipment, the wireless device acting as the DHCP server may alsoprovide to the terminal equipment other parameters that the terminalequipment may use for exchanging data with the network. Some examples ofsuch parameters include Domain Name Server (DNS) IP addresses, defaultDomain Name, other Name Server IP addresses, Interface Maximum TransmitUnit (MTU), and so on. All of these parameters are known in the art. Thewireless device may obtain these parameters from the network via networkspecific mechanisms and pass these parameters to the terminal equipmentby encapsulating the parameters in a DHCP message. For example, if thewireless device is in communication with a CDMA network, then thewireless device may obtain these parameters during Point-to-PointProtocol (PPP) negotiation with the CDMA network. The wireless devicealso acts as a proxy for all IP addresses on the subnet and responds toARP requests sent by the terminal equipment. The wireless deviceforwards IP packets exchanged between the terminal equipment anddestination hosts and only intercepts and processes IP packets intendedfor the DHCP server. The wireless device further terminates Ethernetframes received from the terminal equipment and originates Ethernetframes to the terminal equipment.

FIG. 8 shows a block diagram of terminal equipment 110 and wirelessdevice 120. Terminal equipment 110 includes a controller 810, a memory812, and NIC-Em 112. Controller 810 performs processing for the terminalequipment and further directs the operation of various units within theterminal equipment. Controller 810 may implement the DHCP client for thedynamic IP configuration shown in FIG. 7, perform processing to send andreceive IP packets, and so on. Memory unit 812 stores program code anddata used by controller 810. NIC-Em 112 provides an interface towireless device 120 and may perform processing for IP and Ethernet.NIC-Em 112 may be implemented with software (e.g., by controller 810) orhardware.

Wireless device 120 includes a wireless modem for communication withwireless network 130, a controller 840, a memory 842, and acommunication (Comm) unit 844. On the transmit path of the wirelessmodem, data and signaling to be sent by the wireless device areprocessed (e.g., formatted, encoded, and interleaved) by an encoder 822and further processed (e.g., modulated, spread/channelized, andscrambled) by a modulator (Mod) 824 to obtain a stream of data chips. Atransmitter unit (TMTR) 832 then conditions (e.g., converts to analog,filters, amplifies, and frequency upconverts) the data chip stream togenerate an uplink signal, which is routed through a duplexer (D) 834and transmitted via an antenna 836. On the receive path, downlinksignals transmitted by base stations in the wireless network (e.g., aCDMA or UMTS network) are received by antenna 836, routed throughduplexer 834, and provided to a receiver unit (RCVR) 838. Receiver unit838 conditions (e.g., filters, amplifies, and frequency downconverts)the received signal and further digitizes the conditioned signal toobtain data samples. A demodulator (Demod) 826 processes (e.g.,descrambles, despeads/channelizes, and demodulates) the samples toobtain symbols. A decoder 828 further processes (e.g., deinterleaves anddecodes) the symbols to obtain decoded data. Encoder 822, modulator 824,demodulator 826, and decoder 828 may be implemented by a modem processor820. These units perform processing in accordance with the wirelesstechnology (e.g., W-CDMA or IS-2000) of wireless network 130.

Controller 840 directs the operation of the various units withinwireless device 120. Controller 840 may implement processes 400, 412 a,and 520 a shown in FIGS. 4, 5 and 6 and may implement the DHCP serverfor the dynamic IP configuration shown in FIG. 7. Memory unit 842 storesprogram code and data used by controller 840 and other units. Comm unit844 provides an interface to terminal equipment 110 and may performprocessing for IP and Ethernet.

The techniques described herein for dynamically configuring IP and forsupporting IP connectivity for an attached terminal equipment may beused in conjunction with various wireless networks. These wirelessnetworks may implement various wireless technologies such as the 3GPP2and 3GPP families of technologies, IEEE 802.11, Bluetooth, and so on.These techniques may also be used for other existing and future wirelessnetwork technologies.

The techniques described herein may be implemented by various means. Forexample, these techniques may be implemented in hardware, software, or acombination thereof. For a hardware implementation, the processing unitsused to perform the dynamic IP configuration and to support IPconnectivity may be implemented within one or more application specificintegrated circuits (ASICs), digital signal processors (DSPs), digitalsignal processing devices (DSPDs), programmable logic devices (PLDs),field programmable gate arrays (FPGAs), processors, controllers,micro-controllers, microprocessors, other electronic units designed toperform the functions described herein, or a combination thereof.

For a software implementation, the techniques described herein may beimplemented with modules (e.g., procedures, functions, and so on) thatperform the functions described herein. The software codes may be storedin a memory unit (e.g., memory unit 842 in FIG. 8) and executed by aprocessor (e.g., controller 840). The memory unit may be implementedwithin the processor or external to the processor, in which case it canbe communicatively coupled to the processor via various means as isknown in the art.

The previous description of the disclosed embodiments is provided toenable any person skilled in the art to make or use the presentinvention. Various modifications to these embodiments will be readilyapparent to those skilled in the art, and the generic principles definedherein may be applied to other embodiments without departing from thespirit or scope of the invention. Thus, the present invention is notintended to be limited to the embodiments shown herein but is to beaccorded the widest scope consistent with the principles and novelfeatures disclosed herein.

1. A method of providing Internet Protocol (IP) connectivity for aterminal equipment coupled to a wireless device that is in communicationwith a wireless network, comprising: determining a host IP address, arouter IP address, and a subnet mask; and providing the host IP address,the router IP address, and the subnet mask to the terminal equipment,wherein the host IP address, router IP address, and subnet mask are usedby the terminal equipment to exchange IP packets.
 2. The method of claim1, further comprising: receiving an IP packet from the terminalequipment; and forwarding the IP packet to the wireless network.
 3. Themethod of claim 1, further comprising: receiving from the wirelessnetwork an IP packet with the host IP address as a destination IPaddress; and forwarding the IP packet to the terminal equipment.
 4. Themethod of claim 1, further comprising: obtaining IP configuration fromthe wireless network, and wherein the host IP address, the router IPaddress, and the subnet mask are determined using the IP configurationobtained from the wireless network.
 5. The method of claim 4, whereinthe IP configuration obtained from the wireless network includes an IPaddress dynamically assigned to the wireless device by the wirelessnetwork, and wherein the host IP address is set to the dynamicallyassigned IP address.
 6. The method of claim 1, wherein the host IPaddress is an IP address statically assigned to the wireless device. 7.The method of claim 4, wherein the IP configuration obtained from thewireless network includes the subnet mask.
 8. The method of claim 4,wherein the IP configuration obtained from the wireless network includesthe router IP address.
 9. The method of claim 1, wherein the host IPaddress, the router IP address, and the subnet mask are provided to theterminal equipment via a Dynamic Host Configuration Protocol (DHCP). 10.The method of claim 9, further comprising: providing a server IP addressto the terminal equipment, the server IP address being an IP address fora DHCP server implemented by the wireless device.
 11. The method ofclaim 10, wherein the server IP address is set to the router IP address.12. The method of claim 10, further comprising: receiving an IP packetfrom the terminal equipment; determining whether the IP packet isintended for the DHCP server; and processing the IP packet at thewireless device if the IP packet is intended for the DHCP server. 13.The method of claim 12, further comprising: sending a DHCP response backto the terminal equipment if the IP packet is intended for the DHCPserver.
 14. The method of claim 1, further comprising: providing to theterminal equipment a Domain Name Server (DNS) IP address, a defaultDomain Name, an other Name Server IP address, an Interface MaximumTransmit Unit (MTU), or a combination thereof.
 15. The method of claim1, further comprising: obtaining a gateway IP address from the wirelessnetwork, the gateway IP address being an IP address for an IP gatewayused to route IP packets for the wireless network; and setting therouter IP address to the gateway IP address if the gateway IP addressbelongs to the same subnet as the host IP address.
 16. An apparatus forproviding Internet Protocol (IP) connectivity for a terminal equipmentcoupled to a wireless device that is in communication with a wirelessnetwork, the apparatus comprising: A processor that determines a host IPaddress, a router IP address, and a subnet mask; and A transmitter thatprovides the host IP address, the router IP address, and the subnet maskto the terminal equipment, wherein the host IP address, router IPaddress, and subnet mask are used by the terminal equipment to exchangeIP packets.
 17. An apparatus for providing Internet Protocol (IP)connectivity for a terminal equipment coupled to a wireless device thatis in communication with a wireless network, the apparatus comprising:means for determining a host IP address, a router IP address, and asubnet mask; and means for providing the host IP address, the router IPaddress, and the subnet mask to the terminal equipment, wherein the hostIP address, router IP address, and subnet mask are used by the terminalequipment to exchange IP packets.
 18. A computer program product,comprising: non-transitory computer-readable medium embodying codes forproviding Internet Protocol (IP) connectivity for a terminal equipmentcoupled to a wireless device that is in communication with a wirelessnetwork, the codes comprising: codes for causing a computer to determinea host IP address, a router IP address, and a subnet mask; and codes forcausing the computer to provide the host IP address, the router IPaddress, and the subnet mask to the terminal equipment, wherein the hostIP address, router IP address, and subnet mask are used by the terminalequipment to exchange IP packets.